package day05;

import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {

        int[] array=new int[10];
        int  a=array[0];
        for (int i=0;i<array.length;i++){
            array[i]=(int)(Math.random()*100);
            System.out.println(array[i]);
            if (array[i]>a){
                a=array[i];
            }
        }
        System.out.println("------------------");
        Arrays.sort(array);
        for (int i=0;i<array.length;i++){
            System.out.println(array[i]);
        }
        System.out.println(a);
        System.out.println("---------------");
        for (int i=array.length-1;i>=0;i--){
            System.out.println(array[i]);
        }
    }
}
